package com.maxd.respository.helpTask;

import com.maxd.model.HelpClassify;
import com.maxd.model.HelpClassifyDetails;
import com.maxd.model.HelpMaintainDetails;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface HelpClassifyDetailsRepository extends Repository<HelpClassifyDetails, Long> {


    @Query(value = "select * from help_classify_details where id=:id",nativeQuery = true)
    HelpClassifyDetails selectById(@Param("id") Long id);

    @Query(value = "select * from help_classify_details order by sort",nativeQuery = true)
    List<HelpClassifyDetails> selectList();

    @Query(value = "select * from help_classify_details where classify_id=:classifyId order by sort",nativeQuery = true)
    List<HelpClassifyDetails> selectList(@Param("classifyId") Long classifyId);

    @Query(value = "select * from help_classify_details where classify_deatils_name like CONCAT('%',:classifyName,'%')",nativeQuery = true)
    List<HelpClassifyDetails> selectList(@Param("classifyName") String classifyName);

}
